package hc.bre.policy

import hc.bre.ComponentConfig
import hc.bre.cmn.ListOption
import hc.bre.cmn.RuleScriptBuilder
import hc.bre.cmn.IDetailList
import hc.bre.cmn.RuleDefinition
import hc.bre.data.encoder.EncoderItem

@groovy.transform.CompileStatic
@groovy.transform.ToString(includeNames=true,includePackage=false)
class ReasonDefinition  extends RuleDefinition implements IDetailList<ReasonItem>{
	public static final ComponentConfig _config ;
	static {
		_config = new ComponentConfig();
		_config.rtype = 'data:policy:reason';
		_config.rname = '政策原因(码)';
		_config.builderClass = ReasonBuilder;
		_config.homepage = '/rule/policy/reasonhome.htm' ;
		_config.description = '''
''';
	};

	ReasonDefinition(){
		rname = _config.rname;
	}

	List<ReasonItem> list = []

	@Override
	public ReasonDefinition load(Map map) {
		super.load(map);
		list = hc.Util.loadList(map['list'], ReasonItem.class);
		return this;
	}

//	@Override
//	public <T extends RuleScriptBuilder> Class<T> scriptBuilderClass() {
//		return ReasonBuilder.class;
//	}

//	@Override
//	public ReasonItem find(int id) {
//		return list.find{it.id == id};
//	}
}
